     var b; 
     var name1;
     var name2;
     var name3;
     var name4;
     var name5;
     
   function  validate()
    { 
      if(b==false){
    	alert('请将信息填写完整');
        return false;
        }
     }
    function checkForm() 
    {	
      if(KE.util.getPureData('content1')=="")
       {
    	  alert('内容不能为空！')
    	  return false;
        }
      return true;
      
    }
      
      
    window.onload=function()
     { 
      name1=document.getElementsByName("CTopic_ID")[0];
      name1.focus();
      name2=document.getElementsByName("CContent_topic")[0];
      name3=document.getElementsByName("CContent_author")[0];
      name4=document.getElementsByName("CContent_time")[0];
      name1.onblur=function(){
	      var n=this.value;
	      var span;
	     if(n=="")
             {
              b=false;
              if(this.parentNode.childNodes.length>2)
		      this.parentNode.removeChild( this.parentNode.childNodes[this.parentNode.childNodes.length-1]);
              span=document.createElement("span");
              span.style.color="red";
              span.style.fontSize="12px";
              span.style.paddingLeft="50px";
              span.innerHTML="(*类型必须选择)";
              this.parentNode.appendChild(span);
		  }else
		     { 
			   name2.focus();
		      if(this.parentNode.childNodes.length>2)
		    {
		      this.parentNode.removeChild( this.parentNode.childNodes[this.parentNode.childNodes.length-1]);
	    	}
	     }
	 }
	 name2.onblur=function(){
	      var n=this.value;
	      var span;
	     if(n==""  )
             {
              b=false;
              if(this.parentNode.childNodes.length>2)
		      this.parentNode.removeChild( this.parentNode.childNodes[this.parentNode.childNodes.length-1]);
              span=document.createElement("span");
              span.style.color="red";
              span.style.fontSize="12px";
              span.style.padding="20px";
              span.innerHTML="(*主题不能为空)";
              this.parentNode.appendChild(span);
		  }else
		     {  
			    
		         if(this.parentNode.childNodes.length>2)
		    	  {
		          name3.focus();
		         this.parentNode.removeChild( this.parentNode.childNodes[this.parentNode.childNodes.length-1]);
		}
		    	  }
	 }
	  name3.onblur=function(){
	      var n=this.value;
	      var span;
	     if(n==""  ||  n.length>10  )
             {
             b=false;
             if(this.parentNode.childNodes.length>2)
             this.parentNode.removeChild( this.parentNode.childNodes[this.parentNode.childNodes.length-1]);
             span=document.createElement("span");
             span.style.color="red";
             span.style.padding="20px";
             span.style.fontSize="12px";
             span.innerHTML="(*作者不能为空)";
             this.parentNode.appendChild(span);
		  }else
		     {  
		     if(this.parentNode.childNodes.length>2){
		     name4.focus();
		     this.parentNode.removeChild( this.parentNode.childNodes[this.parentNode.childNodes.length-1]);
		}
	   }
	 }
	   	 name4.onblur=function(){
	      var n=this.value;
	      var span;
	     if(n.length=="")
             {
             b=false;
             if(this.parentNode.childNodes.length>2)
             this.parentNode.removeChild( this.parentNode.childNodes[this.parentNode.childNodes.length-1]);
             span=document.createElement("span");
             span.style.color="red";
             span.style.padding="20px";
             span.style.fontSize="12px";
             span.innerHTML="(*时间不能为空)";
             this.parentNode.appendChild(span);
		  }
		 
		  else
		     {  
			 b=true;
		      if(this.parentNode.childNodes.length>2)
		     {
		      this.parentNode.removeChild( this.parentNode.childNodes[this.parentNode.childNodes.length-1]);
			}
	   }
	 }
	   	 
	   	 if(result!='null'  &&  result!=undefined)
        {
             alert(result);
        }  
  }
    
      
		KE.show({
			id : 'content1',
			imageUploadJson : 'kindeditor/jsp/upload_json.jsp',
			fileManagerJson : 'kindeditor/jsp/file_manager_json.jsp',
			allowFileManager : true,
			afterCreate : function(id) {
				KE.event.ctrl(document, 13, function() {
					KE.util.setData(id);
					document.forms['example'].submit();
					
				});
				KE.event.ctrl(KE.g[id].iframeDoc, 13, function() {
					KE.util.setData(id);
					document.forms['example'].submit();
				});
			}
		});
		